import api from "./api";
import type Typings from "@/typings";

export default {
  buttonListApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/button/list";
    return api.post(url, data, { ...config });
  },

  buttonAddApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/button/add";
    return api.post(url, data, { ...config, openLoading: true });
  },

  buttonUpdateApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/button/update";
    return api.post(url, data, { ...config, openLoading: true });
  },

  buttonCheckApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/button/check";
    return api.get(url, data, { ...config });
  },

  buttonRemoveApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/api/button/remove";
    return api.get(url, data, { ...config });
  },
};
